import { http } from '@/utils/http'

const baseUrl = '/core/product'
const ProductApi = {
  getProductList(productType: string) {
    let query = encodeURIComponent(JSON.stringify({ pageNum: 1, pageSize: 999, productType }))
    return http<productInfoPage[]>({
      url: `${baseUrl}/getProductList?object=${query}`,
      method: 'GET',
    })
  },
}
export default ProductApi

export type productInfoPage = {
  accCode: null
  accName: null
  approvalName: null
  approvalTime: null
  approvalUser: null
  barcode: null
  basketCapacity: number
  categoryCode: 'PCATE00044'
  categoryName: '花菜类'
  code: 'PRO0000052'
  companyCode: null
  costCurrency: null
  costPrice: 1
  createName: 'testkk'
  createTime: '2025-03-13 17:25:50'
  createUser: 91
  ctnGrossWeight: 1
  ctnH: 40
  ctnL: 20
  ctnNetWeight: 2
  ctnVolume: null
  ctnW: 30
  expireDay: 1
  genNo: null
  id: 59
  isDelete: 0
  labels: null
  lengthUnit: null
  minOrderQty: 1
  modifyName: 'testkk'
  modifyTime: '2025-03-13 17:25:50'
  modifyUser: 91
  otherName: null
  packageSize: '20×30×40'
  packageType: '普通包装'
  pageNum: null
  pageSize: null
  prefix: null
  productName: '啊上档次'
  productType: 1
  purchaseDays: null
  remark: '阿萨德大多数'
  safetyQty: 1
  salesCurrency: null
  salesPrice: 1
  status: null
  timeScopes: null
  unit: null
  volumeUnit: null
  warehouseCode: '2'
  weightUnit: null
}
